package cn.edu.wynu;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class AnnotationBasedMain {
    public static void main(String[] args) {
        // 加载 Spring 配置类
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);

        // 获取 Fish 对象
        Fish fish = (Fish) context.getBean("fish");

        // 输出 Fish 对象的内容
        System.out.println(fish);
    }
}